3.168 \(\int \frac {1+x+x^2+x^3}{1+x^4} \, dx\)

Optimal. Leaf size=53 \[ \frac {1}{4} \log \left (x^4+1\right )+\frac {1}{2} \tan ^{-1}\left (x^2\right )-\frac {\tan ^{-1}\left (1-\sqrt {2} x\right )}{\sqrt {2}}+\frac {\tan ^{-1}\left (\sqrt {2} x+1\right )}{\sqrt {2}} \]

[Out]

1/2*arctan(x^2)+1/4*ln(x^4+1)+1/2*arctan(-1+x*2^(1/2))*2^(1/2)+1/2*arctan(1+x*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.471, Rules used = {1876, 1162, 617, 204, 1248, 635, 203, 260} \[ \frac {1}{4} \log \left (x^4+1\right )+\frac {1}{2} \tan ^{-1}\left (x^2\right )-\frac {\tan ^{-1}\left (1-\sqrt {2} x\right )}{\sqrt {2}}+\frac {\tan ^{-1}\left (\sqrt {2} x+1\right )}{\sqrt {2}} \]

Antiderivative was successfully verified.

[In]

Int[(1 + x + x^2 + x^3)/(1 + x^4),x]

[Out]

ArcTan[x^2]/2 - ArcTan[1 - Sqrt[2]*x]/Sqrt[2] + ArcTan[1 + Sqrt[2]*x]/Sqrt[2] + Log[1 + x^4]/4

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 617

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[(a*c)/b^2]}, Dist[-2/b, Sub
st[Int[1/(q - x^2), x], x, 1 + (2*c*x)/b], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 1162

Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[(2*d)/e, 2]}, Dist[e/(2*c), Int[1/S
imp[d/e + q*x + x^2, x], x], x] + Dist[e/(2*c), Int[1/Simp[d/e - q*x + x^2, x], x], x]] /; FreeQ[{a, c, d, e},
 x] && EqQ[c*d^2 - a*e^2, 0] && PosQ[d*e]

Rule 1248

Int[(x_)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[Int[(d + e*x)^q
*(a + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, c, d, e, p, q}, x]

Rule 1876

Int[(Pq_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = Sum[(x^ii*(Coeff[Pq, x, ii] + Coeff[Pq, x, n/2 + ii
]*x^(n/2)))/(a + b*x^n), {ii, 0, n/2 - 1}]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && IGtQ
[n/2, 0] && Expon[Pq, x] < n

Rubi steps

\begin {align*} \int \frac {1+x+x^2+x^3}{1+x^4} \, dx &=\int \left (\frac {1+x^2}{1+x^4}+\frac {x \left (1+x^2\right )}{1+x^4}\right ) \, dx\\ &=\int \frac {1+x^2}{1+x^4} \, dx+\int \frac {x \left (1+x^2\right )}{1+x^4} \, dx\\ &=\frac {1}{2} \int \frac {1}{1-\sqrt {2} x+x^2} \, dx+\frac {1}{2} \int \frac {1}{1+\sqrt {2} x+x^2} \, dx+\frac {1}{2} \operatorname {Subst}\left (\int \frac {1+x}{1+x^2} \, dx,x,x^2\right )\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,x^2\right )+\frac {1}{2} \operatorname {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,x^2\right )+\frac {\operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} x\right )}{\sqrt {2}}-\frac {\operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} x\right )}{\sqrt {2}}\\ &=\frac {1}{2} \tan ^{-1}\left (x^2\right )-\frac {\tan ^{-1}\left (1-\sqrt {2} x\right )}{\sqrt {2}}+\frac {\tan ^{-1}\left (1+\sqrt {2} x\right )}{\sqrt {2}}+\frac {1}{4} \log \left (1+x^4\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 50, normalized size = 0.94 \[ \frac {1}{4} \left (\log \left (x^4+1\right )-2 \left (1+\sqrt {2}\right ) \tan ^{-1}\left (1-\sqrt {2} x\right )+2 \left (\sqrt {2}-1\right ) \tan ^{-1}\left (\sqrt {2} x+1\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + x + x^2 + x^3)/(1 + x^4),x]

[Out]

(-2*(1 + Sqrt[2])*ArcTan[1 - Sqrt[2]*x] + 2*(-1 + Sqrt[2])*ArcTan[1 + Sqrt[2]*x] + Log[1 + x^4])/4

________________________________________________________________________________________

fricas [B]  time = 0.72, size = 145, normalized size = 2.74 \[ -\sqrt {-2 \, \sqrt {2} + 3} \arctan \left (\sqrt {x^{2} + \sqrt {2} x + 1} {\left (\sqrt {2} + 2\right )} \sqrt {-2 \, \sqrt {2} + 3} - {\left (\sqrt {2} {\left (x + 1\right )} + 2 \, x + 1\right )} \sqrt {-2 \, \sqrt {2} + 3}\right ) + \sqrt {2 \, \sqrt {2} + 3} \arctan \left (-{\left (\sqrt {2} {\left (x + 1\right )} - \sqrt {x^{2} - \sqrt {2} x + 1} {\left (\sqrt {2} - 2\right )} - 2 \, x - 1\right )} \sqrt {2 \, \sqrt {2} + 3}\right ) + \frac {1}{4} \, \log \left (x^{2} + \sqrt {2} x + 1\right ) + \frac {1}{4} \, \log \left (x^{2} - \sqrt {2} x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3+x^2+x+1)/(x^4+1),x, algorithm="fricas")

[Out]

-sqrt(-2*sqrt(2) + 3)*arctan(sqrt(x^2 + sqrt(2)*x + 1)*(sqrt(2) + 2)*sqrt(-2*sqrt(2) + 3) - (sqrt(2)*(x + 1) +
 2*x + 1)*sqrt(-2*sqrt(2) + 3)) + sqrt(2*sqrt(2) + 3)*arctan(-(sqrt(2)*(x + 1) - sqrt(x^2 - sqrt(2)*x + 1)*(sq
rt(2) - 2) - 2*x - 1)*sqrt(2*sqrt(2) + 3)) + 1/4*log(x^2 + sqrt(2)*x + 1) + 1/4*log(x^2 - sqrt(2)*x + 1)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 70, normalized size = 1.32 \[ \frac {1}{2} \, {\left (\sqrt {2} - 1\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + \sqrt {2}\right )}\right ) + \frac {1}{2} \, {\left (\sqrt {2} + 1\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x - \sqrt {2}\right )}\right ) + \frac {1}{4} \, \log \left (x^{2} + \sqrt {2} x + 1\right ) + \frac {1}{4} \, \log \left (x^{2} - \sqrt {2} x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3+x^2+x+1)/(x^4+1),x, algorithm="giac")

[Out]

1/2*(sqrt(2) - 1)*arctan(1/2*sqrt(2)*(2*x + sqrt(2))) + 1/2*(sqrt(2) + 1)*arctan(1/2*sqrt(2)*(2*x - sqrt(2)))
+ 1/4*log(x^2 + sqrt(2)*x + 1) + 1/4*log(x^2 - sqrt(2)*x + 1)

________________________________________________________________________________________

maple [B]  time = 0.05, size = 102, normalized size = 1.92 \[ \frac {\arctan \left (x^{2}\right )}{2}+\frac {\sqrt {2}\, \arctan \left (\sqrt {2}\, x -1\right )}{2}+\frac {\sqrt {2}\, \arctan \left (\sqrt {2}\, x +1\right )}{2}+\frac {\sqrt {2}\, \ln \left (\frac {x^{2}-\sqrt {2}\, x +1}{x^{2}+\sqrt {2}\, x +1}\right )}{8}+\frac {\sqrt {2}\, \ln \left (\frac {x^{2}+\sqrt {2}\, x +1}{x^{2}-\sqrt {2}\, x +1}\right )}{8}+\frac {\ln \left (x^{4}+1\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^3+x^2+x+1)/(x^4+1),x)

[Out]

1/2*2^(1/2)*arctan(2^(1/2)*x-1)+1/8*2^(1/2)*ln((x^2+2^(1/2)*x+1)/(x^2-2^(1/2)*x+1))+1/2*2^(1/2)*arctan(2^(1/2)
*x+1)+1/2*arctan(x^2)+1/8*2^(1/2)*ln((x^2-2^(1/2)*x+1)/(x^2+2^(1/2)*x+1))+1/4*ln(x^4+1)

________________________________________________________________________________________

maxima [A]  time = 3.00, size = 76, normalized size = 1.43 \[ -\frac {1}{4} \, \sqrt {2} {\left (\sqrt {2} - 2\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + \sqrt {2}\right )}\right ) + \frac {1}{4} \, \sqrt {2} {\left (\sqrt {2} + 2\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x - \sqrt {2}\right )}\right ) + \frac {1}{4} \, \log \left (x^{2} + \sqrt {2} x + 1\right ) + \frac {1}{4} \, \log \left (x^{2} - \sqrt {2} x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3+x^2+x+1)/(x^4+1),x, algorithm="maxima")

[Out]

-1/4*sqrt(2)*(sqrt(2) - 2)*arctan(1/2*sqrt(2)*(2*x + sqrt(2))) + 1/4*sqrt(2)*(sqrt(2) + 2)*arctan(1/2*sqrt(2)*
(2*x - sqrt(2))) + 1/4*log(x^2 + sqrt(2)*x + 1) + 1/4*log(x^2 - sqrt(2)*x + 1)

________________________________________________________________________________________

mupad [B]  time = 0.40, size = 156, normalized size = 2.94 \[ \ln \left (\left (16\,x-16\right )\,\left (\frac {\sqrt {-2\,\sqrt {2}-3}}{4}+\frac {1}{4}\right )-8\,x\right )\,\left (\frac {\sqrt {-2\,\sqrt {2}-3}}{4}+\frac {1}{4}\right )-\ln \left (8\,x+\left (16\,x-16\right )\,\left (\frac {\sqrt {-2\,\sqrt {2}-3}}{4}-\frac {1}{4}\right )\right )\,\left (\frac {\sqrt {-2\,\sqrt {2}-3}}{4}-\frac {1}{4}\right )-\ln \left (8\,x+\left (16\,x-16\right )\,\left (\frac {\sqrt {2\,\sqrt {2}-3}}{4}-\frac {1}{4}\right )\right )\,\left (\frac {\sqrt {2\,\sqrt {2}-3}}{4}-\frac {1}{4}\right )+\ln \left (8\,x-\left (16\,x-16\right )\,\left (\frac {\sqrt {2\,\sqrt {2}-3}}{4}+\frac {1}{4}\right )\right )\,\left (\frac {\sqrt {2\,\sqrt {2}-3}}{4}+\frac {1}{4}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x + x^2 + x^3 + 1)/(x^4 + 1),x)

[Out]

log((16*x - 16)*((- 2*2^(1/2) - 3)^(1/2)/4 + 1/4) - 8*x)*((- 2*2^(1/2) - 3)^(1/2)/4 + 1/4) - log(8*x + (16*x -
 16)*((- 2*2^(1/2) - 3)^(1/2)/4 - 1/4))*((- 2*2^(1/2) - 3)^(1/2)/4 - 1/4) - log(8*x + (16*x - 16)*((2*2^(1/2)
- 3)^(1/2)/4 - 1/4))*((2*2^(1/2) - 3)^(1/2)/4 - 1/4) + log(8*x - (16*x - 16)*((2*2^(1/2) - 3)^(1/2)/4 + 1/4))*
((2*2^(1/2) - 3)^(1/2)/4 + 1/4)

________________________________________________________________________________________

sympy [A]  time = 0.43, size = 73, normalized size = 1.38 \[ \frac {\log {\left (x^{2} - \sqrt {2} x + 1 \right )}}{4} + \frac {\log {\left (x^{2} + \sqrt {2} x + 1 \right )}}{4} + 2 \left (\frac {1}{4} + \frac {\sqrt {2}}{4}\right ) \operatorname {atan}{\left (\sqrt {2} x - 1 \right )} + 2 \left (- \frac {1}{4} + \frac {\sqrt {2}}{4}\right ) \operatorname {atan}{\left (\sqrt {2} x + 1 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**3+x**2+x+1)/(x**4+1),x)

[Out]

log(x**2 - sqrt(2)*x + 1)/4 + log(x**2 + sqrt(2)*x + 1)/4 + 2*(1/4 + sqrt(2)/4)*atan(sqrt(2)*x - 1) + 2*(-1/4
+ sqrt(2)/4)*atan(sqrt(2)*x + 1)

________________________________________________________________________________________